package com.css.zfzx.fwsjcj.modules.report.controller;

import com.alibaba.fastjson.JSONObject;
import com.css.bpm.platform.base.response.RestResponse;
import com.css.zfzx.fwsjcj.config.image.ConfigBeanValue;
import com.css.zfzx.fwsjcj.modules.analysis.service.SiftAnalysisService;
import com.css.zfzx.fwsjcj.modules.analysis.vo.AnalysisQueryVo;
import com.css.zfzx.fwsjcj.modules.report.service.XCReportService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import sun.misc.BASE64Decoder;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.File;
import java.io.FileOutputStream;
import java.io.OutputStream;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/***
 * 生成详查报告
 */
@RestController
@RequestMapping("/fw/XCReport")
@Slf4j
public class XCReportController {
    @Autowired
    private ConfigBeanValue configBeanValue;
    @Autowired
    private XCReportService xcReportService;
    @Autowired
    SiftAnalysisService siftAnalysisService;
    @GetMapping("exportXC")
    public RestResponse exportXcReport(String province, String city,String area,String taskName,String timeStamp, HttpServletRequest request, HttpServletResponse response){
        RestResponse restResponse=null;
        JSONObject jsonObject=new JSONObject();
        try {
            xcReportService.exportReport(province,city,area,taskName,timeStamp,request,response);
            jsonObject.put("message","生成报告成功");
            restResponse=RestResponse.succeed(jsonObject);
        }catch (Exception e){
            String errormessage="生成报告失败";
            log.error(errormessage,e);
            restResponse=RestResponse.fail(errormessage);
        }
        return restResponse;
    }

    /**
     * 将base64编码转成图片格式并保存到本地，并返回虚拟路径
     * @param base64Info
     * @param fileName
     * @return
     */
    @RequestMapping("/image")
    public Map<String, String> image(String base64Info, String fileName){
        String targetDirectory = configBeanValue.wordImage;
        String virtualPath = configBeanValue.virtualPath;
        //确保图片名称的唯一性
        String filename = fileName + ".png";
        String imagePath = virtualPath + File.separator + filename;
        String savePath = targetDirectory + File.separator + filename;
        base64Info = base64Info.split("base64,")[1];
        try {
            BASE64Decoder decoder = new BASE64Decoder();
            byte[] data = decoder.decodeBuffer(base64Info);
            // 调整异常数据
            for (int i = 0; i < data.length; ++i) {
                if (data[i] < 0) {
                    data[i] += 256;
                }
            }
            File file = new File(targetDirectory);
            if(!file.exists()){
                file.mkdirs();
            }
            OutputStream os = new FileOutputStream(savePath);
            os.write(data);
            os.close();
        }catch (Exception e){
            e.printStackTrace();
        }
        Map<String,String> map = new HashMap<>();
        map.put("imageUrl",imagePath);
        return map;
    }

    /**
     * 获取报告的数据柱状饼状
     * @param analysisQueryVo
     * @return
     */
    @GetMapping("/getDate")
    public RestResponse buildingDate(AnalysisQueryVo analysisQueryVo){
        RestResponse response = null;
        JSONObject json = new JSONObject();
        try {
            //柱状数量和面积
            Map<String, Object> buildingNum = siftAnalysisService.buildingNumData(AnalysisQueryVo.getOne(analysisQueryVo));
            Map<String, Object> buildingArea = siftAnalysisService.buildingAreaData(AnalysisQueryVo.getOne(analysisQueryVo));
            // 建筑年代栋数和面积
            List<Map> buildingTimeNum = siftAnalysisService.buildingNumDataByBuildingTime(AnalysisQueryVo.getOne(analysisQueryVo));
            List<Map> buildingTimeArea = siftAnalysisService.buildingAreaDataByBuildingTime(AnalysisQueryVo.getOne(analysisQueryVo));
            // 抗震设防烈度栋数和面积
            List<Map> fortificationIntensityNum = siftAnalysisService.buildingNumDataByFortificationIntensity(AnalysisQueryVo.getOne(analysisQueryVo));
            List<Map> fortificationIntensityArea = siftAnalysisService.buildingAreaDataByFortificationIntensity(AnalysisQueryVo.getOne(analysisQueryVo));
            //砖混结构
            //墙体
            //外墙厚度栋数和面积
            List<Map> brickOutWallThickNum = xcReportService.brickOutWallThickNum(AnalysisQueryVo.getOne(analysisQueryVo));
            List<Map> brickOutWallThickArea = xcReportService.brickOutWallThickArea(AnalysisQueryVo.getOne(analysisQueryVo));
            //内墙厚度栋数和面积
            List<Map> brickInWallThickNum = xcReportService.brickInWallThickNum(AnalysisQueryVo.getOne(analysisQueryVo));
            List<Map> brickInWallThickArea = xcReportService.brickInWallThickArea(AnalysisQueryVo.getOne(analysisQueryVo));
            //墙体材质
            List<Map> brickWallMaterialNum = xcReportService.brickWallMaterialNum(AnalysisQueryVo.getOne(analysisQueryVo));
            List<Map> brickWallMaterialArea = xcReportService.brickWallMaterialArea(AnalysisQueryVo.getOne(analysisQueryVo));
            //砂浆
            //砂浆类型
            List<Map> brickMortarTypeNum = xcReportService.brickMortarTypeNum(AnalysisQueryVo.getOne(analysisQueryVo));
            List<Map> brickMortarTypeArea = xcReportService.brickMortarTypeArea(AnalysisQueryVo.getOne(analysisQueryVo));
            //砂浆强度
            List<Map> brickMortarStrengthNum = xcReportService.brickMortarStrengthNum(AnalysisQueryVo.getOne(analysisQueryVo));
            List<Map> brickMortarStrengthArea = xcReportService.brickMortarStrengthArea(AnalysisQueryVo.getOne(analysisQueryVo));
            //楼屋盖
            //屋盖类别
            List<Map> brickRoofTypeNum = xcReportService.brickRoofTypeNum(AnalysisQueryVo.getOne(analysisQueryVo));
            List<Map> brickRoofTypeArea = xcReportService.brickRoofTypeArea(AnalysisQueryVo.getOne(analysisQueryVo));
            //楼盖类别
            List<Map> brickFloorTypeNum = xcReportService.brickFloorTypeNum(AnalysisQueryVo.getOne(analysisQueryVo));
            List<Map> brickFloorTypeArea = xcReportService.brickFloorTypeArea(AnalysisQueryVo.getOne(analysisQueryVo));
            //抗震构造
            //圈梁设置
            List<Map> brickJlInstallNum = xcReportService.brickJlInstallNum(AnalysisQueryVo.getOne(analysisQueryVo));
            List<Map> brickJlInstallArea = xcReportService.brickJlInstallArea(AnalysisQueryVo.getOne(analysisQueryVo));

            //砖木结构
            //墙体
            //外墙厚度栋数和面积
            List<Map> brickwoodOutWallThickNum = xcReportService.brickwoodOutWallThickNum(AnalysisQueryVo.getOne(analysisQueryVo));
            List<Map> brickwoodOutWallThickArea = xcReportService.brickwoodOutWallThickArea(AnalysisQueryVo.getOne(analysisQueryVo));
            //内墙厚度栋数和面积
            List<Map> brickwoodInWallThickNum = xcReportService.brickwoodInWallThickNum(AnalysisQueryVo.getOne(analysisQueryVo));
            List<Map> brickwoodInWallThickArea = xcReportService.brickwoodInWallThickArea(AnalysisQueryVo.getOne(analysisQueryVo));
            //墙体材质
            List<Map> brickwoodWallMaterialNum = xcReportService.brickwoodWallMaterialNum(AnalysisQueryVo.getOne(analysisQueryVo));
            List<Map> brickwoodWallMaterialArea = xcReportService.brickwoodWallMaterialArea(AnalysisQueryVo.getOne(analysisQueryVo));
            //砂浆
            //砂浆类型
            List<Map> brickwoodMortarTypeNum = xcReportService.brickwoodMortarTypeNum(AnalysisQueryVo.getOne(analysisQueryVo));
            List<Map> brickwoodMortarTypeArea = xcReportService.brickwoodMortarTypeArea(AnalysisQueryVo.getOne(analysisQueryVo));
            //砂浆强度
            List<Map> brickwoodMortarStrengthNum = xcReportService.brickwoodMortarStrengthNum(AnalysisQueryVo.getOne(analysisQueryVo));
            List<Map> brickwoodMortarStrengthArea = xcReportService.brickwoodMortarStrengthArea(AnalysisQueryVo.getOne(analysisQueryVo));
            //楼屋盖
            //屋盖类别
            List<Map> brickwoodRoofTypeNum = xcReportService.brickwoodRoofTypeNum(AnalysisQueryVo.getOne(analysisQueryVo));
            List<Map> brickwoodRoofTypeArea = xcReportService.brickwoodRoofTypeArea(AnalysisQueryVo.getOne(analysisQueryVo));
            //楼盖类别
            List<Map> brickwoodFloorTypeNum = xcReportService.brickwoodFloorTypeNum(AnalysisQueryVo.getOne(analysisQueryVo));
            List<Map> brickwoodFloorTypeArea = xcReportService.brickwoodFloorTypeArea(AnalysisQueryVo.getOne(analysisQueryVo));
            //抗震构造
            //圈梁设置
            List<Map> brickwoodJlInstallNum = xcReportService.brickwoodJlInstallNum(AnalysisQueryVo.getOne(analysisQueryVo));
            List<Map> brickwoodJlInstallArea = xcReportService.brickwoodJlInstallArea(AnalysisQueryVo.getOne(analysisQueryVo));

            //多层钢筋混凝土结构
            //柱
            //柱混凝土强度等级
            List<Map> mulZhntqdLevelNum = xcReportService.mulZhntqdLevelNum(AnalysisQueryVo.getOne(analysisQueryVo));
            List<Map> mulZhntqdLevelArea = xcReportService.mulZhntqdLevelArea(AnalysisQueryVo.getOne(analysisQueryVo));
          /*  //主要柱截面尺寸
            List<Map> mulZyzjmSizeNum = xcReportService.mulZyzjmSizeNum(analysisQueryVo);
            List<Map> mulZyzjmSizeArea = xcReportService.mulZyzjmSizeArea(analysisQueryVo);*/
            //最大主间距
            List<Map> mulZdzSpanNum = xcReportService.mulZdzSpanNum(AnalysisQueryVo.getOne(analysisQueryVo));
            List<Map> mulZdzSpanArea = xcReportService.mulZdzSpanArea(AnalysisQueryVo.getOne(analysisQueryVo));
            //剪力墙
            //剪力墙混凝土强度等级
            List<Map> mulJlqhntqdLevelNum = xcReportService.mulJlqhntqdLevelNum(AnalysisQueryVo.getOne(analysisQueryVo));
            List<Map> mulJlqhntqdLevelArea = xcReportService.mulJlqhntqdLevelArea(AnalysisQueryVo.getOne(analysisQueryVo));
            //剪力墙最大间距
            List<Map> mulJlqzdSpanNum = xcReportService.mulJlqzdSpanNum(AnalysisQueryVo.getOne(analysisQueryVo));
            List<Map> mulJlqzdSpanArea = xcReportService.mulJlqzdSpanArea(AnalysisQueryVo.getOne(analysisQueryVo));
            //剪力墙厚度
            List<Map> mulShearwellThicknessNum = xcReportService.mulShearwellThicknessNum(AnalysisQueryVo.getOne(analysisQueryVo));
            List<Map> mulShearwellThicknessArea = xcReportService.mulShearwellThicknessArea(AnalysisQueryVo.getOne(analysisQueryVo));
            //楼屋盖
            //屋盖类别
            List<Map> mulRoofTypeNum = xcReportService.mulRoofTypeNum(AnalysisQueryVo.getOne(analysisQueryVo));
            List<Map> mulRoofTypeArea = xcReportService.mulRoofTypeArea(AnalysisQueryVo.getOne(analysisQueryVo));
            //楼盖类别
            List<Map> mulFloorTypeNum = xcReportService.mulFloorTypeNum(AnalysisQueryVo.getOne(analysisQueryVo));
            List<Map> mulFloorTypeArea = xcReportService.mulFloorTypeArea(AnalysisQueryVo.getOne(analysisQueryVo));
            //高层结构
            //柱
            //柱混凝土强度等级
            List<Map> heightZhntqdLevelNum = xcReportService.heightZhntqdLevelNum(AnalysisQueryVo.getOne(analysisQueryVo));
            List<Map> heightZhntqdLevelArea = xcReportService.heightZhntqdLevelArea(AnalysisQueryVo.getOne(analysisQueryVo));
          /*  //主要柱截面尺寸
            List<Map> heightZyzjmSizeNum = xcReportService.heightZyzjmSizeNum(analysisQueryVo);
            List<Map> heightZyzjmSizeArea = xcReportService.heightZyzjmSizeArea(analysisQueryVo);*/
            //最大柱间距
            List<Map> heightZdzSpanNum = xcReportService.heightZdzSpanNum(AnalysisQueryVo.getOne(analysisQueryVo));
            List<Map> heightZdzSpanArea = xcReportService.heightZdzSpanArea(AnalysisQueryVo.getOne(analysisQueryVo));
            //剪力墙
            //剪力墙混凝土强度等级
            List<Map> heightJlqhntqdLevelNum = xcReportService.heightJlqhntqdLevelNum(AnalysisQueryVo.getOne(analysisQueryVo));
            List<Map> heightJlqhntqdLevelArea = xcReportService.heightJlqhntqdLevelArea(AnalysisQueryVo.getOne(analysisQueryVo));
            //剪力墙最大间距
            List<Map> heightJlqzdSpanNum = xcReportService.heightJlqzdSpanNum(AnalysisQueryVo.getOne(analysisQueryVo));
            List<Map> heightJlqzdSpanArea = xcReportService.heightJlqzdSpanArea(AnalysisQueryVo.getOne(analysisQueryVo));
            //剪力墙厚度
            List<Map> heightShearwellThicknessNum = xcReportService.heightShearwellThicknessNum(AnalysisQueryVo.getOne(analysisQueryVo));
            List<Map> heightShearwellThicknessArea = xcReportService.heightShearwellThicknessArea(AnalysisQueryVo.getOne(analysisQueryVo));
            //楼屋盖
            //屋盖类别
            List<Map> heightRoofTypeNum = xcReportService.heightRoofTypeNum(AnalysisQueryVo.getOne(analysisQueryVo));
            List<Map> heightRoofTypeArea= xcReportService.heightRoofTypeArea(AnalysisQueryVo.getOne(analysisQueryVo));
            //楼盖类别
            List<Map> heightFloorTypeNum = xcReportService.heightFloorTypeNum(AnalysisQueryVo.getOne(analysisQueryVo));
            List<Map> heightFloorTypeArea = xcReportService.heightFloorTypeArea(AnalysisQueryVo.getOne(analysisQueryVo));
            //工业厂房结构
            //柱
            //排架柱类型
            List<Map> factoryBentFrameColTypeNum = xcReportService.factoryBentFrameColTypeNum(AnalysisQueryVo.getOne(analysisQueryVo));
            List<Map> factoryBentFrameColTypeArea = xcReportService.factoryBentFrameColTypeArea(AnalysisQueryVo.getOne(analysisQueryVo));
            //各跨跨度
            List<Map> factorySpansNum = xcReportService.factorySpansNum(AnalysisQueryVo.getOne(analysisQueryVo));
            List<Map> factorySpansArea = xcReportService.factorySpansArea(AnalysisQueryVo.getOne(analysisQueryVo));
            //排架柱距
            List<Map> factoryBentFrameColSpaceNum = xcReportService.factoryBentFrameColSpaceNum(AnalysisQueryVo.getOne(analysisQueryVo));
            List<Map> factoryBentFrameColSpaceArea = xcReportService.factoryBentFrameColSpaceArea(AnalysisQueryVo.getOne(analysisQueryVo));
            //楼屋盖
            //屋盖体系
            List<Map> factoryRoofSystemNum = xcReportService.factoryRoofSystemNum(AnalysisQueryVo.getOne(analysisQueryVo));
            List<Map> factoryRoofSystemArea = xcReportService.factoryRoofSystemArea(AnalysisQueryVo.getOne(analysisQueryVo));
            //屋架形式
            List<Map> factoryRoofTrussStyleNum = xcReportService.factoryRoofTrussStyleNum(AnalysisQueryVo.getOne(analysisQueryVo));
            List<Map> factoryRoofTrussStyleArea = xcReportService.factoryRoofTrussStyleArea(AnalysisQueryVo.getOne(analysisQueryVo));
            //抗震构造
            List<Map> factoryRingBeamNumNum = xcReportService.factoryRingBeamNumNum(AnalysisQueryVo.getOne(analysisQueryVo));
            List<Map> factoryRingBeamNumArea = xcReportService.factoryRingBeamNumArea(AnalysisQueryVo.getOne(analysisQueryVo));

            //空旷结构
            //柱
            //柱类型
            List<Map> wideColTypeNum = xcReportService.wideColTypeNum(AnalysisQueryVo.getOne(analysisQueryVo));
            List<Map> wideColTypeArea = xcReportService.wideColTypeArea(AnalysisQueryVo.getOne(analysisQueryVo));
            //柱跨度
            List<Map> wideColSpanNum = xcReportService.wideColSpanNum(AnalysisQueryVo.getOne(analysisQueryVo));
            List<Map> wideColSpanArea = xcReportService.wideColSpanArea(AnalysisQueryVo.getOne(analysisQueryVo));
            //柱距
            List<Map> wideColSpaceNum = xcReportService.wideColSpaceNum(AnalysisQueryVo.getOne(analysisQueryVo));
            List<Map> wideColSpaceArea = xcReportService.wideColSpaceArea(AnalysisQueryVo.getOne(analysisQueryVo));
            //楼屋盖
            //屋面类别
            List<Map> wideWmTypeNum = xcReportService.wideWmTypeNum(AnalysisQueryVo.getOne(analysisQueryVo));
            List<Map> wideWmTypeArea = xcReportService.wideWmTypeArea(AnalysisQueryVo.getOne(analysisQueryVo));
            //屋架形式
            List<Map> wideWjGenreNum = xcReportService.wideWjGenreNum(AnalysisQueryVo.getOne(analysisQueryVo));
            List<Map> wideWjGenreArea = xcReportService.wideWjGenreArea(AnalysisQueryVo.getOne(analysisQueryVo));
            //抗震构造
            //圈梁道数
            List<Map> wideRingBeamNum = xcReportService.wideRingBeamNum(AnalysisQueryVo.getOne(analysisQueryVo));
            List<Map> wideRingBeamArea = xcReportService.wideRingBeamArea(AnalysisQueryVo.getOne(analysisQueryVo));

            //土木结构
            //墙体
            //墙体类型
            List<Map> buildingWallTypeNum = xcReportService.buildingWallTypeNum(AnalysisQueryVo.getOne(analysisQueryVo));
            List<Map> buildingWallTypeArea = xcReportService.buildingWallTypeArea(AnalysisQueryVo.getOne(analysisQueryVo));
            //墙体延性材料
            List<Map> buildingQtyxclNum = xcReportService.buildingQtyxclNum(AnalysisQueryVo.getOne(analysisQueryVo));
            List<Map> buildingQtyxclArea = xcReportService.buildingQtyxclArea(AnalysisQueryVo.getOne(analysisQueryVo));
            //墙体厚度
            List<Map> buildingWallThickNum = xcReportService.buildingWallThickNum(AnalysisQueryVo.getOne(analysisQueryVo));
            List<Map> buildingWallThickArea = xcReportService.buildingWallThickArea(AnalysisQueryVo.getOne(analysisQueryVo));
            //门窗洞口宽度
            List<Map> buildingWindowWidthNum = xcReportService.buildingWindowWidthNum(AnalysisQueryVo.getOne(analysisQueryVo));
            List<Map> buildingWindowWidthArea = xcReportService.buildingWindowWidthArea(AnalysisQueryVo.getOne(analysisQueryVo));
            //屋架材料
            List<Map> buildingWmMaterialNum = xcReportService.buildingWmMaterialNum(AnalysisQueryVo.getOne(analysisQueryVo));
            List<Map> buildingWmMaterialArea = xcReportService.buildingWmMaterialArea(AnalysisQueryVo.getOne(analysisQueryVo));
            //墙体圈梁
            List<Map> buildingWallRingBeamNum = xcReportService.buildingWallRingBeamNum(AnalysisQueryVo.getOne(analysisQueryVo));
            List<Map> buildingWallRingBeamArea = xcReportService.buildingWallRingBeamArea(AnalysisQueryVo.getOne(analysisQueryVo));

            //木结构
            //木结构
            //穿斗方式
            List<Map> woodCdTypeNum = xcReportService.woodCdTypeNum(AnalysisQueryVo.getOne(analysisQueryVo));
            List<Map> woodCdTypeArea = xcReportService.woodCdTypeArea(AnalysisQueryVo.getOne(analysisQueryVo));
            //木柱梢径
            List<Map> woodMzsjNum = xcReportService.woodMzsjNum(AnalysisQueryVo.getOne(analysisQueryVo));
            List<Map> woodMzsjArea = xcReportService.woodMzsjArea(AnalysisQueryVo.getOne(analysisQueryVo));
            //墙体
            //围护墙体类型
            List<Map> woodWallTypeNum = xcReportService.woodWallTypeNum(AnalysisQueryVo.getOne(analysisQueryVo));
            List<Map> woodWallTypeArea = xcReportService.woodWallTypeArea(AnalysisQueryVo.getOne(analysisQueryVo));
            //山尖墙体类型
            List<Map> woodSjqtTypeNum = xcReportService.woodSjqtTypeNum(AnalysisQueryVo.getOne(analysisQueryVo));
            List<Map> woodSjqtTypeArea = xcReportService.woodSjqtTypeArea(AnalysisQueryVo.getOne(analysisQueryVo));
            //墙体厚度
            List<Map> woodWallThickNum = xcReportService.woodWallThickNum(AnalysisQueryVo.getOne(analysisQueryVo));
            List<Map> woodWallThickArea = xcReportService.woodWallThickArea(AnalysisQueryVo.getOne(analysisQueryVo));
            //抗震构造
            //墙体圈梁
            List<Map> woodWallRingBeamNum = xcReportService.woodWallRingBeamNum(AnalysisQueryVo.getOne(analysisQueryVo));
            List<Map> woodWallRingBeamArea = xcReportService.woodWallRingBeamArea(AnalysisQueryVo.getOne(analysisQueryVo));

            //石结构
            //墙体
            //墙体材质
            List<Map> stoneWallMaterialNum = xcReportService.stoneWallMaterialNum(AnalysisQueryVo.getOne(analysisQueryVo));
            List<Map> stoneWallMaterialArea = xcReportService.stoneWallMaterialArea(AnalysisQueryVo.getOne(analysisQueryVo));
            //横墙最大间距
            List<Map> stoneHqzdSpaceNum = xcReportService.stoneHqzdSpaceNum(AnalysisQueryVo.getOne(analysisQueryVo));
            List<Map> stoneHqkdSpaceArea = xcReportService.stoneHqzdSpaceArea(AnalysisQueryVo.getOne(analysisQueryVo));
            //墙体厚度
            List<Map> stoneWallThickNum = xcReportService.stoneWallThickNum(AnalysisQueryVo.getOne(analysisQueryVo));
            List<Map> stoneWallThickArea = xcReportService.stoneWallThickArea(AnalysisQueryVo.getOne(analysisQueryVo));
            //横墙开洞面积
            List<Map> stoneHqkdAreaNum = xcReportService.stoneHqkdAreaNum(AnalysisQueryVo.getOne(analysisQueryVo));
            List<Map> stoneHqkdAreaArea = xcReportService.stoneHqkdAreaArea(AnalysisQueryVo.getOne(analysisQueryVo));
            //屋盖类型
            List<Map> stoneRoofTypeNum = xcReportService.stoneRoofTypeNum(AnalysisQueryVo.getOne(analysisQueryVo));
            List<Map> stoneRoofTypeArea = xcReportService.stoneRoofTypeArea(AnalysisQueryVo.getOne(analysisQueryVo));
            //抗震构造
            //圈梁
            List<Map> stoneQlNum = xcReportService.stonQlNum(AnalysisQueryVo.getOne(analysisQueryVo));
            List<Map> stoneQlArea = xcReportService.stoneQlArea(AnalysisQueryVo.getOne(analysisQueryVo));
            //四角设构造柱
            List<Map> stoneSjsgzzNum = xcReportService.stonSjsgzzNum(AnalysisQueryVo.getOne(analysisQueryVo));
            List<Map> stoneSjsgzzArea = xcReportService.stoneSjsgzzArea(AnalysisQueryVo.getOne(analysisQueryVo));

            //其他结构
            //剪力墙混凝土强度等级
            List<Map> otherJlqhntqdLevelNum = xcReportService.otherJlqhntqdLevelNum(AnalysisQueryVo.getOne(analysisQueryVo));
            List<Map> otherJlqhntqdLevelArea = xcReportService.otherJlqhntqdLevelArea(AnalysisQueryVo.getOne(analysisQueryVo));
            /*//剪力墙厚度
            List<Map> otherShearwellThicknessNum = xcReportService.otherShearwellThicknessNum(AnalysisQueryVo.getOne(analysisQueryVo));
            List<Map> otherShearwellThicknessArea = xcReportService.otherShearwellThicknessArea(AnalysisQueryVo.getOne(analysisQueryVo));*/
            //剪力墙最大间距
            List<Map> otherJlqzdSpanNum = xcReportService.otherJlqzdSpanNum(AnalysisQueryVo.getOne(analysisQueryVo));
            List<Map> otherJlqzdSpanArea = xcReportService.otherJlqzdSpanArea(AnalysisQueryVo.getOne(analysisQueryVo));
            //砂浆类型
            List<Map> otherMortarTypeNum = xcReportService.otherMortarTypeNum(AnalysisQueryVo.getOne(analysisQueryVo));
            List<Map>otherMortarTypeArea = xcReportService.otherMortarTypeArea(AnalysisQueryVo.getOne(analysisQueryVo));
            //墙体材质
            List<Map> otherMaterialNum = xcReportService.otherWallMaterialNum(AnalysisQueryVo.getOne(analysisQueryVo));
            List<Map> otherMaterialArea = xcReportService.otherWallMaterialArea(AnalysisQueryVo.getOne(analysisQueryVo));
            //楼盖类别
            List<Map> otherFloorTypeNum = xcReportService.otherFloorTypeNum(AnalysisQueryVo.getOne(analysisQueryVo));
            List<Map> otherFloorTypeArea = xcReportService.otherFloorTypeArea(AnalysisQueryVo.getOne(analysisQueryVo));
            //屋盖类别
            List<Map> otherRoofTypeNum = xcReportService.otherRoofTypeNum(AnalysisQueryVo.getOne(analysisQueryVo));
            List<Map> otherRoofTypeArea = xcReportService.otherRoofTypeArea(AnalysisQueryVo.getOne(analysisQueryVo));


            //抗震设防设施
            json.put("fortificationIntensityNum", fortificationIntensityNum);
            json.put("fortificationIntensityArea", fortificationIntensityArea);
            //年代占比
            json.put("buildingTimeNum", buildingTimeNum);
            json.put("buildingTimeArea", buildingTimeArea);
            //建筑数量
            json.put("buildingNum", buildingNum);
            json.put("buildingArea", buildingArea);
            //砖混外墙厚度
            json.put("brickOutWallThickNum",brickOutWallThickNum);
            json.put("brickOutWallThickArea",brickOutWallThickArea);
            //砖混内墙厚度
            json.put("brickInWallThickNum",brickInWallThickNum);
            json.put("brickInWallThickArea",brickInWallThickArea);
            //砖混楼盖类别
            json.put("brickFloorTypeNum",brickFloorTypeNum);
            json.put("brickFloorTypeArea",brickFloorTypeArea);
            //砖混圈梁设置
            json.put("brickJlInstallNum",brickJlInstallNum);
            json.put("brickJlInstallArea",brickJlInstallArea);
            //砖混砂浆强度
            json.put("brickMortarStrengthNum",brickMortarStrengthNum);
            json.put("brickMortarStrengthArea",brickMortarStrengthArea);
            //砖混砂浆类型
            json.put("brickMortarTypeNum",brickMortarTypeNum);
            json.put("brickMortarTypeArea",brickMortarTypeArea);
            //砖混屋盖类别
            json.put("brickRoofTypeNum",brickRoofTypeNum);
            json.put("brickRoofTypeArea",brickRoofTypeArea);
            //砖混墙体材质
            json.put("brickWallMaterialNum",brickWallMaterialNum);
            json.put("brickWallMaterialArea",brickWallMaterialArea);

            //砖木外墙厚度
            json.put("brickwoodOutWallThickNum",brickwoodOutWallThickNum);
            json.put("brickwoodOutWallThickArea",brickwoodOutWallThickArea);
            //砖木内墙厚度
            json.put("brickwoodInWallThickNum",brickwoodInWallThickNum);
            json.put("brickwoodInWallThickArea",brickwoodInWallThickArea);
            //砖木楼盖类别
            json.put("brickwoodFloorTypeNum",brickwoodFloorTypeNum);
            json.put("brickwoodFloorTypeArea",brickwoodFloorTypeArea);
            //砖木圈梁设置
            json.put("brickwoodJlInstallNum",brickwoodJlInstallNum);
            json.put("brickwoodJlInstallArea",brickwoodJlInstallArea);
            //砖木砂浆强度
            json.put("brickwoodMortarStrengthNum",brickwoodMortarStrengthNum);
            json.put("brickwoodMortarStrengthArea",brickwoodMortarStrengthArea);
            //砖木砂浆类型
            json.put("brickwoodMortarTypeNum",brickwoodMortarTypeNum);
            json.put("brickwoodMortarTypeArea",brickwoodMortarTypeArea);
            //砖木屋盖类别
            json.put("brickwoodRoofTypeNum",brickwoodRoofTypeNum);
            json.put("brickwoodRoofTypeArea",brickwoodRoofTypeArea);
            //砖木墙体材质
            json.put("brickwoodWallMaterialNum",brickwoodWallMaterialNum);
            json.put("brickwoodWallMaterialArea",brickwoodWallMaterialArea);

            //多层钢筋混凝土柱混凝土强度等级
            json.put("mulZhntqdLevelNum",mulZhntqdLevelNum);
            json.put("mulZhntqdLevelArea",mulZhntqdLevelArea);
           /* //多层钢筋混凝土主要截面尺寸
            json.put("mulZyzjmSizeNum",mulZyzjmSizeNum);
            json.put("mulZyzjmSizeArea",mulZyzjmSizeArea);*/
            //多层钢筋混凝土最大柱间距
            json.put("mulZdzSpanNum",mulZdzSpanNum);
            json.put("mulZdzSpanArea",mulZdzSpanArea);
            //多层钢筋混凝土剪力墙混凝土强度等级
            json.put("mulJlqhntqdLevelNum",mulJlqhntqdLevelNum);
            json.put("mulJlqhntqdLevelArea",mulJlqhntqdLevelArea);
            //多层钢筋混凝土剪力墙最大间距
            json.put("mulJlqzdSpanNum",mulJlqzdSpanNum);
            json.put("mulJlqzdSpanArea",mulJlqzdSpanArea);
            //多层钢筋混凝土剪力墙厚度
            json.put("mulShearwellThicknessNum",mulShearwellThicknessNum);
            json.put("mulShearwellThicknessArea",mulShearwellThicknessArea);
            //多层钢筋混凝土楼盖类别
            json.put("mulFloorTypeNum",mulFloorTypeNum);
            json.put("mulFloorTypeArea",mulFloorTypeArea);
            //多层钢筋混凝土屋盖类别
            json.put("mulRoofTypeNum",mulRoofTypeNum);
            json.put("mulRoofTypeArea",mulRoofTypeArea);
            //高层结构柱混凝土强度等级
            json.put("heightZhntqdLevelNum",heightZhntqdLevelNum);
            json.put("heightZhntqdLevelArea",heightZhntqdLevelArea);
            //高层结构最大柱间距
            json.put("heightZdzSpanNum",heightZdzSpanNum);
            json.put("heightZdzSpanArea",heightZdzSpanArea);
            //高层结构剪力墙混凝土强度等级
            json.put("heightJlqhntqdLevelNum",heightJlqhntqdLevelNum);
            json.put("heightJlqhntqdLevelArea",heightJlqhntqdLevelArea);
            //高层结构剪力墙最大间距
            json.put("heightJlqzdSpanNum",heightJlqzdSpanNum);
            json.put("heightJlqzdSpanArea",heightJlqzdSpanArea);
            //高层结构剪力墙厚度
            json.put("heightShearwellThicknessNum",heightShearwellThicknessNum);
            json.put("heightShearwellThicknessArea",heightShearwellThicknessArea);
            //高层结构屋盖类别
            json.put("heightRoofTypeNum",heightRoofTypeNum);
            json.put("heightRoofTypeArea",heightRoofTypeArea);
            //高层结构楼盖类别
            json.put("heightFloorTypeNum",heightFloorTypeNum);
            json.put("heightFloorTypeArea",heightFloorTypeArea);
            //工业厂房排架柱类型
            json.put("factoryBentFrameColTypeNum",factoryBentFrameColTypeNum);
            json.put("factoryBentFrameColTypeArea",factoryBentFrameColTypeArea);
            //工业厂房各跨跨度
            json.put("factorySpansNum",factorySpansNum);
            json.put("factorySpansArea",factorySpansArea);
            //工业厂房排架柱距
            json.put("factoryBentFrameColSpaceNum",factoryBentFrameColSpaceNum);
            json.put("factoryBentFrameColSpaceArea",factoryBentFrameColSpaceArea);
            //工业厂房屋盖体系
            json.put("factoryRoofSystemNum",factoryRoofSystemNum);
            json.put("factoryRoofSystemArea",factoryRoofSystemArea);
            //工业厂房屋架体系
            json.put("factoryRoofTrussStyleNum",factoryRoofTrussStyleNum);
            json.put("factoryRoofTrussStyleArea",factoryRoofTrussStyleArea);
            //工业厂房圈梁道数
            json.put("factoryRingBeamNumNum",factoryRingBeamNumNum);
            json.put("factoryRingBeamNumArea",factoryRingBeamNumArea);
            //空旷结构柱类型
            json.put("wideColTypeNum",wideColTypeNum);
            json.put("wideColTypeArea",wideColTypeArea);
            //空旷结构柱跨度
            json.put("wideColSpanNum",wideColSpanNum);
            json.put("wideColSpanArea",wideColSpanArea);
            //空旷结构柱距
            json.put("wideColSpaceNum",wideColSpaceNum);
            json.put("wideColSpaceArea",wideColSpaceArea);
            //空旷结构屋面类别
            json.put("wideWmTypeNum",wideWmTypeNum);
            json.put("wideWmTypeArea",wideWmTypeArea);
            //空旷结构屋面形式
            json.put("wideWjGenreNum",wideWjGenreNum);
            json.put("wideWjGenreArea",wideWjGenreArea);
            //空旷结构圈梁道数
            json.put("wideRingBeamNum",wideRingBeamNum);
            json.put("wideRingBeamArea",wideRingBeamArea);
            //土木结构
            //墙体
            //墙体类型
            json.put("buildingWallTypeNum",buildingWallTypeNum);
            json.put("buildingWallTypeArea",buildingWallTypeArea);
            //墙体延性材料
            json.put("buildingQtyxclNum",buildingQtyxclNum);
            json.put("buildingQtyxclArea",buildingQtyxclArea);
            //墙体厚度
            json.put("buildingWallThickNum",buildingWallThickNum);
            json.put("buildingWallThickArea",buildingWallThickArea);
            //门窗洞口宽度
            json.put("buildingWindowWidthNum",buildingWindowWidthNum);
            json.put("buildingWindowWidthArea",buildingWindowWidthArea);
            //屋架材料
            json.put("buildingWmMaterialNum",buildingWmMaterialNum);
            json.put("buildingWmMaterialArea",buildingWmMaterialArea);
            //墙体圈梁
            json.put("buildingWallRingBeamNum",buildingWallRingBeamNum);
            json.put("buildingWallRingBeamArea",buildingWallRingBeamArea);
            //木结构
            //穿斗方式
            json.put("woodCdTypeNum",woodCdTypeNum);
            json.put("woodCdTypeArea",woodCdTypeArea);
            //木柱梢径
            json.put("woodMzsjNum",woodMzsjNum);
            json.put("woodMzsjArea",woodMzsjArea);
            //围护墙体类型
            json.put("woodWallTypeNum",woodWallTypeNum);
            json.put("woodWallTypeArea",woodWallTypeArea);
            //山尖墙体类型
            json.put("woodSjqtTypeNum",woodSjqtTypeNum);
            json.put("woodSjqtTypeArea",woodSjqtTypeArea);
            //墙体厚度
            json.put("woodWallThickNum",woodWallThickNum);
            json.put("woodWallThickArea",woodWallThickArea);
            //墙体圈梁
            json.put("woodWallRingBeamNum",woodWallRingBeamNum);
            json.put("woodWallRingBeamArea",woodWallRingBeamArea);
            //石木结构
            //墙体材质
            json.put("stoneWallMaterialNum",stoneWallMaterialNum);
            json.put("stoneWallMaterialArea",stoneWallMaterialArea);
            //横墙最大间距
            json.put("stoneHqzdSpaceNum",stoneHqzdSpaceNum);
            json.put("stoneHqzdSpaceArea",stoneHqkdSpaceArea);
            //墙体厚度
            json.put("stoneWallThickNum",stoneWallThickNum);
            json.put("stoneWallThickArea",stoneWallThickArea);
            //横墙开洞面积
            json.put("stoneHqkdAreaNum",stoneHqkdAreaNum);
            json.put("stoneHqkdAreaArea",stoneHqkdAreaArea);
            //楼屋盖
            //屋盖类型
            json.put("stoneRoofTypeNum",stoneRoofTypeNum);
            json.put("stoneRoofTypeArea",stoneRoofTypeArea);
            //圈梁
            json.put("stoneQlNum",stoneQlNum);
            json.put("stoneQlArea",stoneQlArea);
            //四角设构造柱
            json.put("stoneSjsgzzNum",stoneSjsgzzNum);
            json.put("stoneSjsgzzArea",stoneSjsgzzArea);

            //其他结构
            //其他结构剪力墙混凝土强度等级
            json.put("otherJlqhntqdLevelNum",otherJlqhntqdLevelNum);
            json.put("otherJlqhntqdLevelArea",otherJlqhntqdLevelArea);
            //其他结构剪力墙最大间距
            json.put("otherJlqzdSpanNum",otherJlqzdSpanNum);
            json.put("otherJlqzdSpanArea",otherJlqzdSpanArea);
           /* //其他结构剪力墙厚度
            json.put("heightShearwellThicknessNum",otherShearwellThicknessNum);
            json.put("heightShearwellThicknessArea",otherShearwellThicknessArea);*/
            //其他结构砂浆类型
            json.put("otherMortarTypeNum",otherMortarTypeNum);
            json.put("otherMortarTypeArea",otherMortarTypeArea);
            //其他结构墙体材质
            json.put("otherMaterialNum",otherMaterialNum);
            json.put("otherMaterialArea",otherMaterialArea);
            //其他结构楼盖类别
            json.put("otherFloorTypeNum",otherFloorTypeNum);
            json.put("otherFloorTypeArea",otherFloorTypeArea);
            //其他结构屋盖类别
            json.put("otherRoofTypeNum",otherRoofTypeNum);
            json.put("otherRoofTypeArea",otherRoofTypeArea);

            json.put("message", "查询成功!");
            response = RestResponse.succeed(json);
        } catch (Exception e) {
            String errorMessage = "查询失败!";
            log.error(errorMessage, e);
            response = RestResponse.fail(errorMessage);
        }
        return response;
    }
}
